package com.fourfinance.model.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.fourfinance.model.dao.IpDAO;
import com.fourfinance.model.domain.Ip;
import com.fourfinance.model.service.IpService;

@Service
public class IpServiceImpl implements IpService {
	
	@Autowired
	private IpDAO ipDAO;

	@Transactional
	public void add(Ip ip) {
		ipDAO.add(ip);
	}

	@Transactional
	public List<Ip> list() {
		return ipDAO.list();
	}

	@Transactional
	public void remove(Integer id) {
		ipDAO.remove(id);
	}

	@Transactional
	public Ip getByIpAddress(String ipAddress) {
		return ipDAO.getByIpAddress(ipAddress);
	}

	@Transactional
	public void removeAll() {
		ipDAO.removeAll();		
	}

}
